package com.runvp.service.biz.service.impl;

import java.util.List;
import com.runvp.common.utils.DateUtils;
import com.runvp.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.runvp.service.biz.mapper.BizRechargePackageItemMapper;
import com.runvp.service.biz.domain.BizRechargePackageItem;
import com.runvp.service.biz.service.IBizRechargePackageItemService;
import com.runvp.common.core.text.Convert;

/**
 * 充值套餐选项Service业务层处理
 * 
 * @author runvp
 * @date 2022-09-18
 */
@Service
public class BizRechargePackageItemServiceImpl implements IBizRechargePackageItemService {
    @Autowired
    private BizRechargePackageItemMapper bizRechargePackageItemMapper;

    /**
     * 查询充值套餐选项
     * 
     * @param id 充值套餐选项主键
     * @return 充值套餐选项
     */
    @Override
    public BizRechargePackageItem selectBizRechargePackageItemById(Long id) {
        return bizRechargePackageItemMapper.selectBizRechargePackageItemById(id);
    }

    /**
     * 查询充值套餐选项列表
     * 
     * @param bizRechargePackageItem 充值套餐选项
     * @return 充值套餐选项
     */
    @Override
    public List<BizRechargePackageItem> selectBizRechargePackageItemList(BizRechargePackageItem bizRechargePackageItem) {
        return bizRechargePackageItemMapper.selectBizRechargePackageItemList(bizRechargePackageItem);
    }

    /**
     * 新增充值套餐选项
     * 
     * @param bizRechargePackageItem 充值套餐选项
     * @return 结果
     */
    @Override
    public int insertBizRechargePackageItem(BizRechargePackageItem bizRechargePackageItem) {
        bizRechargePackageItem.setCreateTime(DateUtils.getNowDate());
        bizRechargePackageItem.setCreateBy(ShiroUtils.getLoginName());
        return bizRechargePackageItemMapper.insertBizRechargePackageItem(bizRechargePackageItem);
    }

    /**
     * 修改充值套餐选项
     * 
     * @param bizRechargePackageItem 充值套餐选项
     * @return 结果
     */
    @Override
    public int updateBizRechargePackageItem(BizRechargePackageItem bizRechargePackageItem) {
        bizRechargePackageItem.setUpdateTime(DateUtils.getNowDate());
        bizRechargePackageItem.setUpdateBy(ShiroUtils.getLoginName());
        return bizRechargePackageItemMapper.updateBizRechargePackageItem(bizRechargePackageItem);
    }

    /**
     * 批量删除充值套餐选项
     * 
     * @param ids 需要删除的充值套餐选项主键
     * @return 结果
     */
    @Override
    public int deleteBizRechargePackageItemByIds(String ids) {
        return bizRechargePackageItemMapper.deleteBizRechargePackageItemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除充值套餐选项信息
     * 
     * @param id 充值套餐选项主键
     * @return 结果
     */
    @Override
    public int deleteBizRechargePackageItemById(Long id) {
        return bizRechargePackageItemMapper.deleteBizRechargePackageItemById(id);
    }
}
